package TrafficSim;

import javax.vecmath.Vector2d;

import junit.framework.TestCase;

public class StreetTest extends TestCase {
	private Street s;
	private Vehicle v1;
	private Vehicle v2;
	private Vehicle v3;
	private Vehicle v4;

	protected void setUp() throws Exception {
		s = new Street(50);
		v1 = new Vehicle(new Vector2d(1, 1), 1);
		v2 = new Vehicle(new Vector2d(1, 1), 1);
		v3 = new Vehicle(new Vector2d(1, 1), 1);
		v4 = new Vehicle(new Vector2d(1, 1), 1);

	}

	protected void tearDown() throws Exception {
		super.tearDown();

	}

	// public void testEnterringStreet() {
	// fail("Not yet implemented");
	// }

	public void testGetNextVehicle() {
		s.enterringStreet(v1);
		s.enterringStreet(v2);
		s.enterringStreet(v3);

		assertTrue(v1.equals(s.getNextVehicle(v2)));
		s.leavingStreet(v2);
		assertTrue(v1.equals(s.getNextVehicle(v3)));
		s.enterringStreet(v4);
		assertTrue(v3.equals(s.getNextVehicle(v4)));
	}

}
